CQL Test Server for CQL Tests Runner#360
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #360 +/- ##
=======================================
Coverage 87.58% 87.58%
=======================================
Files 52 52
Lines 4606 4606
Branches 1297 1297
=======================================
Hits 4034 4034
Misses 359 359
Partials 213 213 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- fully self-contained project as subfolder - uses release version of cql-execution
Ideally we would use the code from src directly, but typescript isn't happy
- Use NodeNext module resolution - Specify mocha types in test config
hossenlopp
left a comment
There was a problem hiding this comment.
This approach makes sense. The embedded project makes it always available for running.
I'm not 100% sure if it is universally using cql-execution in the parent directory when cql-exec-fhir is being used. Looking in the package-lock.json shows it is referencing the version on npm. This could cause some oddities with the PatientSource created by cql-exec-fhir, which may be using the npm version instead of the local.
I would try setting up cql-execution as a dependency to ../ and using cql-execution "normally", this hopefully will make sure cql-exec-fhir and your runner code are using the same cql-execution.
elsaperelli
left a comment
There was a problem hiding this comment.
This is awesome!!! Posting some of the review comments I have so far!
Co-authored-by: Elsa Perelli <eperelli@mitre.org>
- Force tsx watch to watch all ts files - Ensure .env is loaded before any other code or imports - Accept Content-Type: application/fhir+json - Add cqf-cqlType extension to example response in README
|
Thanks for the excellent review comments, @elsaperelli. I've accepted the typo suggestions in b5f0daa and implemented fixes for the others in f92c40d. Thanks for keeping me honest. I guess I was rushing to get things done before my vacation more than I realized! |
|
@hossenlopp - Good point regarding IIRC, I did try to do a "normal" import via |
The test-server does not need to support the FHIR model, as all tests are model-agnostic.
|
@hossenlopp - Thanks for noticing the issue with I also investigated what it would take to have the test-server rely on the cql-execution source .ts files directly (instead of relying on compiled source in |
|
@cmoesel Replying to your work on getting the hot-reload setup. It looks like that approach could be slightly fragile. I don't make use of the watch re-run features. I feel like if I was iterating on a fix, it makes more sense to be testing on the tests in the core package instead of the cql-test-server based tests. |
elsaperelli
left a comment
There was a problem hiding this comment.
Just one comment, but I am unsure of it so I will go ahead and approve! Woohoo!
|
I've addressed @hossenlopp's comments, but since he is currently unavailable to re-review, I will merge with @elsaperelli's recent approval. Thanks @hossenlopp and @elsaperelli! |
|
Oh wait! I forgot to add GitHub actions! I will do that first. |
This PR implements a test server that exposes a
$cqltarget to allow the CQL Tests Runner to run tests against thecql-executionengine. Rather than repeat all the details here, I'll refer you to the test-server/README.md file in this branch.I initially developed this as a standalone project outside of
cql-executionthat pulled incql-executionas an NPM dependency. This PR integrates it into thecql-executionproject as a sub-project with its ownpackage.jsonand configuration files. In addition to general review of the code, I'm also interested in thoughts on this approach. Should we:cql-executionbut try to integrate it more closely (i.e., sharepackage.jsonand configuration files)?cql-execution(and if so, where)?I have not yet invested in updating GitHub actions to automatically run the tests or other checks in the sub-project. I will do that after we have confirmed the approach.UPDATE: GitHub Actions are now in place.NOTE: The npm audit check is currently failing due to a reported vulnerability in elliptic. There is currently no fix for that.
Submitter:
npm run test:plusto run tests, lint, and prettier)cql4browsers.jsbuilt withnpm run build:browserifyif source changed.Reviewer:
Name: